@extends('layouts.master3')
@section('style')
<link href="/css/discuss.css" rel="stylesheet">
<link href="/css/challenges.css" rel="stylesheet">
@endsection
@section('title')
讨论区
@endsection
@section('content')
    <div class="contain">
@include('contest/header',['type'=>'discuss'])
        <div class="qa-body-wrapper" style="margin:0;">
            <div class="qa-main-shadow">
                <div class="qa-main-wrapper">
                    <div style="margin:0 auto;width:1050px;">
                        <!-- qa-module E -->
                        <div class="qa-nav-main">
                            <span class="new"><i class="iconfont">&#xe624;</i>最新动态</span>
                            <a href="/ask/contest4" target="_blank" class="btn btn-success pull-right ask-q" style="width:120px;margin-bottom: 5px;font-size:16px;">发起讨论</a>
                            <div class="qa-nav-main-clear">
                            </div>

                        </div>

                        <div class="qa-main">
                            <!--<h1>最新问题与解答</h1>-->
                            <div class="qa-part-q-list">
                                <div class="qa-q-list qa-q-list-vote-disabled">
<?php
use App\Utils;
?>
@foreach($questions as $q)
                                            <div class="qa-q-list-item" id="1">
                                                <div class="qa-q-item-stats">
                                                    <!--<div class="qa-voting qa-voting-net" id="voting_91606">-->
                                                    <!--<div class="qa-vote-count qa-vote-count-net">-->
                                                    <!--<span class="qa-netvote-count">-->
                                                    <!--<span class="qa-netvote-count-data">0</span><span class="qa-netvote-count-pad"> votes</span>-->
                                                    <!--</span>-->
                                                    <!--</div>-->
                                                    <!--<div class="qa-vote-clear"></div>-->
                                                    <!--</div>-->
                                    <span class="qa-a-count qa-a-count-zero">
                                        <span class="qa-a-count-data">{{$q->ansnum}}</span><span class="qa-a-count-pad"> 回答</span>
                                    </span>
                                    <span class="qa-view-count">
                                        <span class="qa-view-count-data">{{$q->vote}}</span><span
                                                class="qa-view-count-pad"> 浏览</span>
                                    </span>

                                                </div>
                                                <div class="qa-q-item-main">
                                                    <div class="qa-q-item-title">
                                                        @if($q->firstc==null)
                                                            <a target="_blank" href="/q/{{Utils::id2url($q->id)}}"><span
                                                                        title="">{{$q->title}}</span></a>

                                                        @else
                                                            <a target="_blank"
                                                               href="/q/{{Utils::id2url($q->id)}}#{{Utils::id2url($q->firstc->id)}}"><span
                                                                        title="">{{$q->title}}</span></a>
                                                        @endif

                                                    </div>
                                    <span class="qa-q-item-avatar-meta">
                                        <span class="qa-q-item-meta">
                                            @if ($q->firstc==null)
                                                <a target="_blank" href="/profile/{{Utils::id2url($q->user->id)}}"
                                                   class="qa-user-link gray">{{$q->user->name}}</a>
                                                <span class="qa-q-item-when"> {{$q->created_at}}提问</span>
                                            @else
                                                <a target="_blank"
                                                   href="/profile/{{Utils::id2url($q->firstc->user->id)}}"
                                                   class="qa-user-link gray">{{$q->firstc->user->name}}</a>
                                                <span class="qa-q-item-when"> {{$q->firstc->created_at}}回答</span>

                                            @endif
                                            @if($q->tag!="其他")
                                                <a class="qa-q-item-class gray" href="/discuss/{{$q->tag}}"
                                                   target="_blank">{{$q->tag}}</a>
                                            @endif
                                        </span>
                                    </span>

                                                </div>
                                                <div class="qa-q-item-clear">
                                                </div>
                                            </div> <!-- END qa-q-list-item -->
 
@endforeach


                                </div>
                                <!-- END qa-q-list -->
                            </div>
                        </div>

                    </div>
                </div>
            </div>
         </div>
        <div style="height:60px;"></div>
    </div>
</div>
@endsection
